package com.hddznet.uniplatform.sm.dto;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

import lombok.Data;

@Data
public class CasToken {
	
	@SerializedName("access_token")
	private String accessToken;
	
	@SerializedName("expires_in")
	private Integer expiresIn;
	
	@SerializedName("refresh_token")
	private String refreshToken;
	
	@SerializedName("token_type")
	private String tokenType;
	
	@SerializedName("user")
	private CasUserinfo userinfo;
	
	public static void main(String[] args) {
		String json = "{\"access_token\":\"8yx5kP4tT-mXeW-V4LlpQA\",\"expires_in\":86400,\"refresh_token\":\"v_ZjxfL-SQmTx2UzcmWK-Q\",\"token_type\":\"Bearer\","
				+ "\"user\":{\"_id\":\"5e60c53fd3ac4a000961cc30\",\"created\":1583400255,\"changed\":1583400255,\"sn\":\"HD678\",\"cid\":null,\"name\":\"zhangkaijun\",\"account\":\"zhangkaijun\",\"sex\":null,\"birth\":null,\"idcard\":null,\"job\":null,"
				+ "\"email\":null,\"mobile\":null,\"imei\":null,\"smobile\":null,\"telephone\":null,\"group\":\"5c9c9593ff5c942dc8a8ad1e\",\"role\":null,"
				+ "\"roless\":[\"5c9ca68cff5c942dc8a8ad46\",\"5cb987639f1f040009e4623c\"],\"order\":111,\"status\":1,\"duty\":null}}\r\n";
		
		Gson gson = new Gson();
		CasToken casToken = gson.fromJson(json, CasToken.class);
		System.out.println(casToken);
	}
}
